package de.hs.rm.UJAdapter.impl;

import java.io.InputStream;
import java.io.IOException;
import org.osgi.service.upnp.UPnPIcon;

class UJIconImpl implements UPnPIcon {
  private int height;
  private int width;
  private int depth;
  private int size;
  private String type;
  private String name;
         
  //creates an icon
  UJIconImpl(int height, int width, int depth, int size,
           String type, String name) {
    this.height = height;
    this.width = width;
    this.depth = depth;
    this.size = size;
    this.type = type;
    this.name = name;
  }
         
  //returns the icon height
  public int getHeight() {
    return height;
  }
         
  // returns the icon width
  public int getWidth() {
    return width;
  }
         
  // returns the icon color depth
  public int getDepth() {
    return depth;
  }
         
  public int getSize() {
    return size; 
  }
         
  // returns the icon mime type
  public String getMimeType() {
    return type;
  }         
         
  // returns an InputStream for reading the icon data
  public InputStream getInputStream() throws IOException {
    InputStream in = this.getClass().getResourceAsStream(name);
    return in;
  }
}